package ch.fhnw.swa.team42.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@NamedQueries({
    @NamedQuery(name = "findAllPersons", query = "SELECT b FROM Person b"),
    @NamedQuery(name = "findPersonById", query = "SELECT b FROM Person b WHERE b.id = :id")
})
@Table(name="Person")
public class Person implements Serializable{
	public Person() {
	}
	// Datenbankfelder
	@Id @GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	@Column(length = 50)
	private String nachname;
	@Column(nullable = false)
	private String vorname;
	
	// Getter & Setters
	public Long getPersonID() {
		return id;
	}
	public void setPersonID(Long id) {
		this.id = id;
	}
	public String getNachname() {
		return nachname;
	}
	public void setNachname(String nachname) {
		this.nachname = nachname;
	}
	public String getVorname() {
		return vorname;
	}
	public void setVorname(String vorname) {
		this.vorname = vorname;
	}
}
